﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Share.Services;

public interface ICipherService
{
    /// <summary>
    /// 公钥加密，私钥解密，备用
    /// </summary>
    /// <param name="data"></param>
    /// <returns></returns>
    byte[] Encrypt(byte[] data);

    /// <summary>
    /// 私钥签名，公钥验签，关键方法
    /// </summary>
    /// <param name="plaintext"></param>
    /// <returns></returns>
    string Sign(string plaintext);
        
    bool Verify(string plaintext, string sign);

    /// <summary>
    /// 密钥对生成，备用
    /// </summary>
    /// <returns></returns>
    (string, string) KeyGen();
}
